using System;
using Sinacor.Servico.Bovespa.Cliente.BusinessEntity;
using Sinacor.Servico.Bovespa.Cliente.Service.DataContract.Response;

namespace Sinacor.Servico.Bovespa.Cliente.Service.ServiceImplementation.Translator
{
    public static class TranslateBetweenEnderecoAndEnderecoResponse
    {
        public static Sinacor.Servico.Bovespa.Cliente.BusinessEntity.Endereco TranslateEnderecoResponseToEndereco(Sinacor.Servico.Bovespa.Cliente.Service.DataContract.Response.EnderecoResponse from)
        {
            Sinacor.Servico.Bovespa.Cliente.BusinessEntity.Endereco to = new Sinacor.Servico.Bovespa.Cliente.BusinessEntity.Endereco();
            to.TipoEndereco = (Sinacor.Servico.Bovespa.Cliente.BusinessEntity.Enum.TipoEndereco) from.Tipo;
            to.Rua = from.Rua;
            to.Numero = from.Numero;
            to.CEP = from.CEP;
            to.Complemento = from.Complemento;
            to.Bairro = from.Bairro;
            to.Cidade = from.Cidade;
            to.UF = from.UF;
            to.Email = from.Email;
            return to;
        }

        public static Sinacor.Servico.Bovespa.Cliente.Service.DataContract.Response.EnderecoResponse TranslateEnderecoToEnderecoResponse(Sinacor.Servico.Bovespa.Cliente.BusinessEntity.Endereco from)
        {
            Sinacor.Servico.Bovespa.Cliente.Service.DataContract.Response.EnderecoResponse to = new Sinacor.Servico.Bovespa.Cliente.Service.DataContract.Response.EnderecoResponse();
            to.Tipo =  (Sinacor.Servico.Bovespa.Cliente.Service.DataContract.Enum.TipoEndereco)from.TipoEndereco;
            to.Rua = from.Rua;
            to.Numero = from.Numero;
            to.CEP = from.CEP;
            to.Complemento = from.Complemento;
            to.Bairro = from.Bairro;
            to.Cidade = from.Cidade;
            to.UF = from.UF;
            to.Email = from.Email;
            return to;
        }
    }
}

